package com.sjmsks.Jpanels.work.utils;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;

import java.io.File;
import java.io.IOException;
import java.util.Map;

public class YamlUtils {

	// TODO 解释器模式的实现
	public static Map<String, Object> YamlToJsonConverter() throws IOException {
		String yamlFilePath = "config.yaml";

		ObjectMapper mapper = new ObjectMapper(new YAMLFactory());

		return mapper.readValue(new File(yamlFilePath), Map.class);
	}

	public static void main(String[] args) throws IOException {
		YamlToJsonConverter();
	}
}
